import { DataTypes } from 'sequelize'
import seq from '@/mysql/db/seq.db'
// 创建数据库模型 校验结果表
const JiaoyanjieguoTable = seq.define(
  'jiaoyanjieguo_table',
  {
    table_id: {
        type: DataTypes.BIGINT,
        allowNull: false,
        unique: true,
        autoIncrement: true,
        primaryKey: true,
        comment: "编号"
      },
    filepath: {
        type: DataTypes.CHAR,
        defaultValue:'',
        comment: "文件路径"
      },
    new_filename: {
        type: DataTypes.CHAR,
        defaultValue:'',
        comment: "新文件的名字"
      },
    original_filename: {
        type: DataTypes.CHAR,
        defaultValue:'',
        comment: "初始文件名称"
      },
    dept_id: {
        type: DataTypes.CHAR,
        defaultValue:'',
        comment: "部门"
      },
    jiaoyanjieguo: {
        type: DataTypes.CHAR,
        defaultValue:'{checkData:[]}',
        comment: "校验结果"
      },
      device_file_version: {
        type: DataTypes.CHAR,
        defaultValue:'',
        comment: "设备文件版本"
      },
      check_result: {
        type: DataTypes.CHAR,
        defaultValue:'0',
        comment: "审核结果"
      },
      check_result_remarks: {
        type: DataTypes.CHAR,
        defaultValue:'',
        comment: "审核意见"
      },
      check_user_id: {
        type: DataTypes.CHAR,
        defaultValue:'',
        comment: "审核人"
      },
    user_id: {
        type: DataTypes.CHAR,
        defaultValue:'',
        comment: "用户"
      },
    create_by: {
        type: DataTypes.CHAR,
        defaultValue:'',
        comment: "创建者"
      },
    update_by: {
        type: DataTypes.CHAR,
        defaultValue:'',
        comment: "更新者"
      },
    created_at: {
        type: DataTypes.DATE,
        defaultValue:'',
        comment: ""
      },
    updated_at: {
        type: DataTypes.DATE,
        defaultValue:'',
        comment: ""
      },

  },
  {
    tableName: 'jiaoyanjieguo_table', // 强制创建表名
    freezeTableName: true, // 告诉sequelize不需要自动将表名变成复数
    comment: '校验结果表'
  }
)

export default JiaoyanjieguoTable